// 微信app
import { request } from '@/utils/request';

export const getWechatApp = () => {
  return new Promise((resolve, reject) => {
    wx.login({
      success(res) {
        const params = {
          code: res.code,
          loginType: 'WX'
        };
        loginApi(params)
          .then(res => {
            resolve(res);
          })
          .catch(res => {
            reject(res);
          });
      },
      fail(res) {
        reject(res);
      }
    });
  });
};

// 检测应用是否有新版本
export const updateAppApi = () => {
  return request({
    url: `/system/`,
    method: 'GET'
  });
};
